home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Test d'un composant */ /* Ce script peut être appelé de deux façons: - en sélectionnant d'abord le composant à tester - en choisissant le composant à tester à l'aide de la requête de fichiers */ /* Le script teste la présence d'une référence et d'une valeur ainsi que les numéros des pastilles (manque numérotation, même numéros utilisés plusieurs fois) */ /* Version 1.00: 22 août 2001, (localisation français/anglais) */ /* Version 1.01: 24 novembre 2001, (ajout test nom) */ /* Version 1.02: 28 décembre 2001, traduction allemand (Greve Axel) */ /* $VER: CheckComp.AmiPCB 1.02 (© R.Florac/A.Greve, 28-Dec-2001) */ options results /* indispensable pour récupérer le résultat des macros */ signal on error /* pour l'interception des erreurs */ signal on syntax lf = '0a'x fr = 'ARexx/InitVars.AmiPCB'() 'FIRSTSEL' if result=0 then do path=getclip(checkcomp_path) if path="" then do 'CLIPPATH("")' path=result end select when fr=1 then 'REQFILE("Composant à tester","'path'","")' when fr=2 then 'REQFILE("Zu prüfende Komponente","'path'","")' otherwise 'REQFILE("Component to check","'path'","")' end composant=result if composant='' then exit 'LOADCLIP(5,"'composant'")' no=result if no<1 then exit call addlib("rexxdossupport.library",0,-30,2) path=PathPart(composant) call setclip(checkcomp_path,path) 'UNMARK(0):PASTE(5,762,762)' if result~=no then do select when fr=1 then 'MESSAGE("Positionnement composant impossible")' when fr=2 then 'MESSAGE("Platzierung der Komponente unmöglich")' otherwise 'MESSAGE("Placement of the component impossible")' end exit end 'MENU("Fix"):ROTATE(0,0):SYMMETRY(0,0):SETSIDE(0,4):WRITE("'composant'",800,800)' end 'FIRSTSEL' if result=0 then do select when fr=1 then 'MESSAGE("Sélectionnez le composant'lf'à tester avant'lf'd''appeler ce script !")' when fr=2 then 'MESSAGE("Selektieren Sie die zu'lf'prüfende Komponente vor'lf'dem Aufruf dieses Skripts !")' otherwise 'MESSAGE("Select the component'lf'to check before'lf'calling this script !")' end exit end /* Test appartenance à un groupe */ select when fr=1 then do msg1 = "Attention un élément au moins"lf"n'appartient pas à un groupe" msg2 = "ATTENTION"lf"Tous les objets ne font"lf"pas partie du même groupe !" end when fr=2 then do msg1 = "WARNUNG"lf"Mindestens ein Element ist"lf"nicht in einer Gruppe enthalten" msg2 = "WARNUNG"lf"Die Objekte sind nicht"lf"in derselben Gruppe !" end otherwise do msg1 = "Warning an element or more"lf"is not included in a group" msg2 = "WARNING"lf"All the objects are not"lf"in the same group !" end end 'INIT(O,G,REF,VAL):O=FIRSTSEL:G=GROUP(O):IF(G==0,MESSAGE("'msg1'"):O=-1,WHILE(O>0,IF(GROUP(O)<>G,MESSAGE("'msg2'"):O=-1,O=NEXTSEL(O)))):O' if result=-1 then exit /* Test du nom du groupe */ 'GETNAME(G)' if result="" then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Le composant ne possède'lf'pas de nom")' when fr=2 then 'MESSAGE("Warnung: Die Komponente'lf'hat keinen Namen")' otherwise 'MESSAGE("Warning: the component'lf'has no name")' end exit end /* Test référence */ 'O=FIRSTSEL:REF=0:WHILE(O>0,IF(TYPE(O)==5,REF=REF+1,0):O=NEXTSEL(O)):REF' if result=0 then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Le composant ne possède'lf'pas de référence")' when fr=2 then 'MESSAGE("WARNUNG'lf'Die Komponente besitzt'lf'keine Referenz")' otherwise 'MESSAGE("WARNING'lf'The component has'lf'no reference")' end exit end else if result>1 then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Le composant possède'lf'plusieurs références")' when fr=2 then 'MESSAGE("WARNUNG'lf'Die Komponente besitzt'lf'mehrere Referenzen")' otherwise 'MESSAGE("WARNING'lf'The component has'lf'several references")' end exit end /* Test valeur */ 'O=FIRSTSEL:VAL=0:WHILE(O>0,IF(TYPE(O)==VALUE,VAL=VAL+1,0):O=NEXTSEL(O)):VAL' if result=0 then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Le composant ne possède'lf'pas de valeur")' when fr=2 then 'MESSAGE("WARNUNG'lf'Die Komponente besitzt'lf'keinen Wert")' otherwise 'MESSAGE("WARNING'lf'The component has'lf'no value")' end end else do if result>1 then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Le composant possède'lf'plusieurs valeurs")' when fr=2 then 'MESSAGE("WARNUNG'lf'Die Komponente besitzt'lf'mehrere Werte")' otherwise 'MESSAGE("WARNING'lf'The component has'lf'several values")' end end end /* Test des numéros de bornes */ pins=0 unpin=0 'FINDOBJ('obj',-PAD,-1,-1)' obj=result do while obj>0 'PADNUM('obj',-1)' pin.pins=result if pin.pins=0 then unpin=unpin+1 pins=pins+1 'FINDOBJ('obj',-PAD,-1,-1)' obj=result end if unpin>0 then do 'CALL("CheckPads")' exit end do i=0 to pins-1 do j=i+1 to pins-1 if pin.i=pin.j & i~=j then do select when fr=1 then 'MESSAGE("ATTENTION'lf'Il y a plusieurs broches numérotées 'pin.i'")' when fr=2 then 'MESSAGE("WARNUNG'lf'Mehrere Pins haben die Nummer 'pin.i'")' otherwise 'MESSAGE("WARNING'lf'Several pins have number 'pin.i'")' end 'FINDOBJ(0,-PAD,-1,-1)' pad=result obj='' do while pad>0 'PADNUM('pad',-1)' if result=pin.i then do if obj='' then obj=pad else obj=obj||','||pad end 'FINDOBJ('pad',-PAD,-1,-1)' pad=result end 'UNMARK(0):MARK('obj')' exit end end end select when fr=1 then 'MESSAGE(IF(VAL>0,"Le composant comprend une valeur'lf'et une référence","Le composant comprend une référence")+"'lf'Ses pastilles sont numérotées'lf'correctement, il peut être'lf'utilisé normalement")' when fr=2 then 'MESSAGE(IF(VAL>0,"Die Komponente hat einen Wert'lf'und eine Referenz","Die Komponente hat eine Referenz")+"'lf'und ihre Pins sind korrekt nummeriert,'lf'sie kann normal verwendet werden")' otherwise 'MESSAGE(IF(VAL>0,"The component has a value'lf'and a reference","The component has a reference")+"'lf'His pads are numbered'lf'correctly, it can'lf'be used normaly")' end exit /* Traitement des erreurs, interruption du programme */ syntax: erreur=RC Call 'ARexx/_Syntax.rexx'(fr,'CheckComp.AmiPCB',SIGL,erreur) exit error: Call 'ARexx/_Error.rexx'(fr,'CheckComp.AmiPCB',SIGL) exit